﻿@using Microsoft.AspNet.Identity
@if (Request.IsAuthenticated)
{
    using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
    {
    @Html.AntiForgeryToken()

    <ul class="nav navbar-nav navbar-right">
        <li><a><span class="glyphicon glyphicon-shopping-cart"></span></a></li>
        <li>
            <a href="@Url.Action("Index","Manage")" title="Manage"><span class="glyphicon glyphicon-user"> 你好，@User.Identity.GetUserName()!</span></a>
        </li>
        <li><a href="javascript:document.getElementById('logoutForm').submit()">注销</a></li>
    </ul>
    }
}
else
{
    <ul class="nav navbar-nav navbar-right">
        <li><a href="https://localhost:44315/Home/Tutorial"><span class="glyphicon glyphicon-shopping-cart"></span></a></li>
        <li>
        <a href="@Url.Action("Login","Account")" id="loginLink"><span class="glyphicon glyphicon-user"></span> 登录</a>
        </li>
        <li>@Html.ActionLink("注册", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
        
    </ul>
}
